package com.cn.stepLock.lambda;

import java.util.function.Function;
import java.util.function.Predicate;

/**
 * @author Aaron
 * @desc
 * @createTime 2020/12/17 15:23
 * @since
 */
public class IfThenElseReturn<T,R> {
    private T inputParameter;
    private Predicate<T> predicate;
    private Function<T,R> then;
    private Function<T,R> elseFunction;

    public IfThenElseReturn(T t, Predicate<T> predicate, Function<T, R> then, Function<T, R> elseFunction) {
        this.inputParameter= t;
        this.predicate = predicate;
        this.then = then;
        this.elseFunction = elseFunction;
    }

    public T getInputParameter() {
        return inputParameter;
    }

    public void setInputParameter(T inputParameter) {
        this.inputParameter = inputParameter;
    }

    public Predicate<T> getPredicate() {
        return predicate;
    }

    public void setPredicate(Predicate<T> predicate) {
        this.predicate = predicate;
    }

    public Function<T, R> getThen() {
        return then;
    }

    public void setThen(Function<T, R> then) {
        this.then = then;
    }

    public Function<T, R> getElseFunction() {
        return elseFunction;
    }

    public void setElseFunction(Function<T, R> elseFunction) {
        this.elseFunction = elseFunction;
    }
}
